/**
 * @file xgame_matrix.c
 *
 */

 /*********************
 *      INCLUDES
 *********************/
#include "xgame_matrix.h"

/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/

/**********************
 *  STATIC PROTOTYPES
 **********************/

 /**********************
 *  STATIC VARIABLES
 **********************/

/**********************
 *      MACROS
 **********************/

/**********************
 *   GLOBAL FUNCTIONS
 **********************/

void matrix_cpy_t2l(uint16_t *left, const uint16_t *top, uint16_t row, uint16_t col)
{
    const uint16_t *end = top + row * col;
    for(; top < end; top += row) *left++ = *top;
}
void matrix_cpy_l2t(uint16_t *top, const uint16_t *left, uint16_t row, uint16_t col)
{
    const uint16_t *end = top + row * col;
    for(; top < end; top += row) *top = *left++;
}

void matrix_cpy_b2l(uint16_t *left, const uint16_t *bottom, uint16_t row, uint16_t col)
{
    const uint16_t *end = bottom - row * col;
    for(; bottom > end; bottom -= row) *left++ = *bottom;
}
void matrix_cpy_l2b(uint16_t *bottom, const uint16_t *left, uint16_t row, uint16_t col)
{
    const uint16_t *end = bottom - row * col;
    for(; bottom > end; bottom -= row) *bottom = *left++;
}

/**********************
 *   STATIC FUNCTIONS
 **********************/
